package cn.gs.service;

import java.util.List;

import cn.gs.dao.CustomerDao;
import cn.gs.dao.CustomerDaoImpl;
import cn.gs.domain.Customer;

public class CustomerServiceImpl implements CustomerService {

	
	CustomerDao customerDao;
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}
	
	@Override
	public void add(Customer customer) {
		CustomerDaoImpl customerDao1=new CustomerDaoImpl();
		customerDao1.add(customer);
	}
	
	public List<Customer>  paging(int page) {
		CustomerDaoImpl customerDao1=new CustomerDaoImpl();
		List<Customer> list= customerDao1.paging(page);
		return list;
	}

	@Override
	public void del(Long id) {
		CustomerDao customerDao1=new CustomerDaoImpl();
		customerDao1.delete(id);;
		
	}

	@Override
	public Customer selectByID(Long id) {
		CustomerDao customerDao1=new CustomerDaoImpl();
		Customer c=customerDao1.selectByID(id);						
		return c;
	}

	@Override
	public void update(Customer c) {
		CustomerDao customerDao1=new CustomerDaoImpl();
		customerDao1.update(c);
		
	}

	@Override
	public List<Customer> selName(String name) {
		CustomerDao customerDao1=new CustomerDaoImpl();
		List<Customer> list= customerDao1.selName(name);
		return list;
	}

	@Override
	public List<Customer> selectAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Customer> selectPageCount() {
		CustomerDaoImpl customerDao1=new CustomerDaoImpl();
		List<Customer> list=customerDao1.selectPageCount();
		return list;
	}

}
